// @import url("https://fonts.googleapis.com/css?family=DM+Sans:400,500,700&display=swap");

@color-background: rgb(243, 246, 253);
@color-card: #ffffff;
@color-selected: rgb(31, 28, 36);
@color-font: rgb(31, 28, 36);

.root {
  font-family: 'DM Sans', sans-serif;
  width: 100%;
  height: 100%;
  background-color: @color-background;

  .no-scrollbar() {
    &::-webkit-scrollbar {
      width: 0;
      height: 0;
    }
  }

  .black {
    background: #000000;
  }

  button {
    background-color: transparent;
    outline: none;
    width: 150px;
    height: 40px;
    margin: 5px 20px;
    font-size: 22px;
    float: right;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    border: 2px solid silver;
    color: silver;
    cursor: pointer;
    user-select: none;
  }

  button:active {
    background-image: linear-gradient(rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.15));
  }

  .header {
    width: 100%;
    height: 36px;
    display: flex;
    align-items: center;
    padding: 0 0 0 24px;

    svg {
      width: 24px;
      height: 24px;
      margin: 0 16px 0 0;
    }

    span {
      font-size: 20px;
    }
  }

  .container {
    margin: 0 10px;
    padding: 10px;
    padding-right: 0;
    height: 90%;
    display: flex;
    border-radius: 10px;

    .headtitle {
      width: 100%;
      height: 50px;
      position: relative;
      display: flex;
      align-items: center;

      svg {
        width: 24px;
        height: 24px;
      }

      span {
        margin-left: 8px;
        font-size: 24px;
        font-weight: bold;
      }

      .step {
        position: absolute;
        top: 10px;
        right: 20px;
        user-select: none;
      }
    }

    .left-controller-bar {
      width: 36px;
      margin: 0 16px 0 0;

      .region-controller() {
        display: flex;
        flex-direction: column;
        margin-top: 24px;
        align-items: center;


        &:hover {
          cursor: pointer;

          .circle {
            transform: scale(1.1);
          }

          span {
            color: @color-font;
            user-select: none;
          }
        }

        .circle {
          border-radius: 100%;
          display: flex;
          align-items: center;
          justify-content: center;
          padding: 6px;
          transition: .3s;
          box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

          svg {
            width: 24px;
            height: 24px;
          }
        }

        span {
          margin-top: 8px;
          font-size: 12px;
          font-weight: bold;
          transition: .3s;
          color: @color-background;
        }
      }

      // Click region controller to set region visibility
      // Use region-hidden when the region is hidden
      // while use region-visible when the region is showing
      .region-hidden {
        .region-controller();

        .circle {
          background: @color-card;

          svg {
            path {
              fill: @color-font;
            }
          }
        }
      }

      .region-visible {
        .region-controller();

        .circle {
          background: black;

          svg {
            path {
              fill: @color-card;
            }
          }
        }
      }
    }

    .left {
      width: 35%;
      height: inherit;
      margin-right: 12px;
      border-radius: 20px;
      background: @color-card;
      padding: 24px;
      box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);

      .uploadFile {
        height: 30px;
        margin-bottom: 10px;

        button {
          margin: 0;
          height: 30px;
          font-size: 10px;
        }
      }

      .codeArea {
        @color-tabbar: rgb(49, 51, 53);
        @color-tab-selected: rgb(76, 75, 88);
        @color-tab-font-color: rgb(243, 246, 253);
        position: relative;

        height: 480px;
        width: 100%;
        resize: none;
        border: none;
        padding: 0;
        border-radius: 10px;
        outline: none;
        font-size: 20px;
        background: @color-tabbar;
        overflow: hidden;

        .tabbar {
          width: 100%;
          height: 36px;
          background: @color-tabbar;
          display: flex;
          flex-direction: row;
          padding-left: 30px;

          .tab {
            margin-top: 6px;
            padding: 0 16px;
            background: @color-tabbar;
            border-top-left-radius: 10px;
            border-top-right-radius: 10px;
            color: @color-tab-font-color;
            font-size: 12px;
            width: max-content;
            height: 30px;
            display: flex;
            justify-content: center;
            align-items: center;
          }

          .tab-selected {
            background: @color-tab-selected;
            box-shadow: 2px -5px 5px #000;
            z-index: 1;
          }
        }
        .highlight {
          height: 20px;
          width: 100%;
          background-color: rgba(255,0,0,1);
          position: absolute;
        }

        .CodeMirror-line > span {
          color: #c8c8c8;
        }
        //.code {
        //  border-radius: 10px;
        //  .no-scrollbar();
        //  height: 500px;
        //  background-color: rgba(43, 43, 43, 1);
        //  overflow: scroll;
        //  color: #A9B7C6;
        //
        //  .line {
        //    height: 500px;
        //    width: 30px;
        //    position: absolute;
        //    background-color: rgba(49, 51, 53, 1);
        //
        //  }
        //
        //  .linenumber {
        //    color: #999;
        //    position: relative;
        //    display: inline-block;
        //    width: 25px;
        //    text-align: right;
        //    padding-right: 5px;
        //  }
        //}
      }
    }

    .right {
      width: 70%;
      height: 90%;
      //margin-left: 12px;
      border-radius: 20px;
      background: @color-card;
      padding: 24px;
      display: flex;
      flex-direction: column;
      box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);

      .waitingState {
        font-size: 56px;
        color: silver;
        display: flex;
        justify-content: center;
        align-items: center;
      }

      .analysis-controller-bar {
        display: flex;
        flex-direction: row;
        margin-left: 16px;

        .circle {
          border-radius: 100%;
          display: flex;
          align-items: center;
          justify-content: center;
          padding: 6px;
          background: transparent;
          transition: .3s;
          margin-left: 8px;

          &:hover {
            background: #000000;
            cursor: pointer;

            svg {
              path {
                fill: #ffffff;
              }
            }
          }

          &:active {
            transform: scale(.8);
            cursor: pointer;

            svg {
              path {
                fill: #ffffff;
              }
            }
          }

          svg {
            width: 16px;
            height: 16px;

            path {
              fill: #000000;
              transition: .3s;
            }
          }
        }
      }

      .speed {
        width: 100px;
        padding-left: 20px;
      }

      .workspace {
        height: 100%;
        width: 100%;
        position: relative;
        display: flex;
        flex-direction: column;

        span {
          color: @color-font;
        }

        .region() {
          &::-webkit-scrollbar {
            width: 0;
            height: 0;
          }
        }

        .gcTitle {
          font-size: 20px;
          margin: 5px;
        }

        .size {
          color: silver;
        }

        .result {
          display: flex;
          flex-wrap: wrap;

        }

        @color-background-allocation: rgb(200, 247, 220);
        @color-background-s: rgb(254, 228, 203);
        @color-background-old: rgb(219, 246, 253);
        @color-object-allocation: #7bed9f; // rgb(52, 196, 113)
        @color-object-s: #ff7f50; // rgb(223, 54, 112)
        @color-object-old: #74b9ff;

        .region() {
          border-radius: 20px;
          padding: 8px 16px;
          box-sizing: border-box;
          transition: .3s;

          * {
            transition: .3s;
          }
        }

        .region-hidden {
          border-radius: 20px;
          box-sizing: border-box;
          transition: .3s;
          color: transparent;

          * {
            transition: .3s;
            color: transparent;
          }
        }

        .young {
          display: flex;
          // flex: 2;
          box-sizing: border-box;
          transition: .3s;

          .obj-allocation {
            background: @color-object-allocation;
            color: white;

            &:hover {
              background: rgb(52, 196, 113);
              cursor: pointer;
            }
          }

          .obj-survivor {
            background: @color-object-s;
            color: white;

            &:hover {
              background: #ff6348;
              cursor: pointer;
            }
          }

          .eden {
            .no-scrollbar();
            .region();
            flex: 2;
            height: 100%;
            background: @color-background-allocation;
            transition: .3s;
          }

          .eden-hidden {
            .no-scrollbar();
            .region-hidden();
            flex: 0;
            width: 0;
            height: 100%;
            overflow: scroll;
            background: @color-background-allocation;
            transition: .3s;
          }

          .survivor {
            flex: 1;
            display: flex;
            height: 100%;
            flex-direction: column;
            margin: 0 0 0 16px;
            transition: .3s;

            .s0 {
              .no-scrollbar();
              .region();
              flex: 1;
              margin-bottom: 16px;
              overflow: scroll;
              background: @color-background-allocation;
            }

            .s1 {
              .no-scrollbar();
              .region();
              flex: 1;
              overflow: scroll;
              background: @color-background-s;
            }
          }

          .survivor-hidden {
            flex: 0;
            margin: 0 0 0 16px;
            width: 0;
            display: flex;
            height: 100%;
            flex-direction: column;
            transition: .3s;

            .s0 {
              .no-scrollbar();
              .region-hidden();
              flex: 1;
              margin-bottom: 16px;
              overflow: scroll;
              background: @color-background-allocation;
            }

            .s1 {
              .no-scrollbar();
              .region-hidden();
              flex: 1;
              overflow: scroll;
              background: @color-background-s;
            }
          }
        }

        .old {
          .obj-old {
            background: @color-object-old;
            color: white;
            transition: .3s;

            &:hover {
              background: #1e90ff;
              cursor: pointer;
            }
          }

          .no-scrollbar();
          .region();
          transition: .3s;
          flex: 1;
          margin-top: 16px;
          overflow: scroll;
          background: @color-background-old;
        }

        .old-hidden {
          .no-scrollbar();
          .region-hidden();
          transition: .3s;
          flex: 0;
          margin-top: 16px;
          overflow: scroll;
          background: @color-background-old;
        }
      }
    }
  }

  .footer {
    margin: 0 auto;
    height: 10px;
  }
}

@keyframes fadeIn {
  from {
    transform: scale(0);
    opacity: 0;
  }

  75% {
    transform: scale(1.05);
    opacity: 1;
  }

  to {
    opacity: 1;
  }
}

.obj {
  height: 30px;
  font-size: 16px;
  // color: rgba(248, 248, 242, 1);
  // background-color: rgba(40, 41, 35, 1);
  margin: 5px;
  padding: 4px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  animation: fadeIn;
  animation-duration: 0.5s;
  transition: 0.5s;
}

.markred {
  border: 2px solid red;
}

//span {
//  color: @color-font;
//}

.none {
  display: none;
}

.red {
  background-color: red;
}

.blue {
  background-color: lightblue;
  color: #595959;
}